Page({
  data: {
    imgs: [
      "https://cdn.jsdelivr.net/gh/zhaojiale15333/img@b201b0f3e80f82151ae599049e015c5557df4808/2021/03/03/e8020b9200bf2393348f4353f452800a.png",
      "https://cdn.jsdelivr.net/gh/zhaojiale15333/img@95e5cbfd5ba14f8708f73a6899fbea541d37aa7d/2021/03/03/00b641672f066a60c44c525e3cad9028.png",
      "https://cdn.jsdelivr.net/gh/zhaojiale15333/img@ae834fa88ef93465e4f2d0b916f39d0fd921f0f6/2021/03/03/8b1866ee74bde7087ef195d2c1df1869.png",
      "https://cdn.jsdelivr.net/gh/zhaojiale15333/img@545b2e71cf7c29aef58178d84920b69512024893/2021/03/03/16c96c0d5a500a27cc610c796ff0bffd.png"
    ],
    swiperCurrent: 0
  },

  start() {
    wx.setStorageSync('isFirst', true)
    wx.switchTab({
      url: '/pages/index/index'
    })
  },
  changItem(e) {
    var num=e.currentTarget.dataset.index
    this.setData({
      swiperCurrent:num
    })
  },
  swiperChange(event) {
    var {
      current,
      source
    } = event.detail
    this.setData({
      swiperCurrent:current
    })
    if (current == 2) {
      let anim = wx.createAnimation({
        timingFunction: 'ease-in-out',
        duration: 1000,
        delay: 0
      })
      anim.opacity(0).step();
      this.setData({
        menuAnim: anim.export()
      })
    }else{
      let anim = wx.createAnimation({
        timingFunction: 'ease-in-out',
        duration: 1000,
        delay: 0
      })
      anim.opacity(1).step();
      this.setData({
        menuAnim: anim.export()
      })
    }
  }


})